#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "user_nvs_flash.h"
#include "driver/ledc.h"
#include <string.h>

#include "app.h"

/**
 * @brief 程序入口
 * @param 无
 * @retval 无
 */

void app_main(void)
{
    int i = 0;
   // user_nvs();
    //user_wifi_task();
   // uart_init();

    xTaskCreatePinnedToCore(Led_Task,"Gpio Task", 2048, NULL, 1, NULL, 1);  // 各种状态处理
    xTaskCreatePinnedToCore(Ble_Task,"Ble_Task",4096,NULL,3,NULL,1);
    xTaskCreatePinnedToCore(uart_event_task,"Uart_Task",4096,NULL,3,NULL,1);
    xTaskCreatePinnedToCore(TM1638_Task,"TM1638_Task",4096,NULL,2,NULL,1);
    xTaskCreatePinnedToCore(App_Task,"App_Task",4096,NULL,2,NULL,1);
    xTaskCreatePinnedToCore(Adc_Task,"Adc_Task",8192,NULL,3,NULL,1);
    xTaskCreatePinnedToCore(Rmt_Task,"Rmt_Task",4096,NULL,3,NULL,1);

    while (1)
    {
        gpio_set_level(BLINK_GPIO, i % 2);
        i ++;

        vTaskDelay(1000);
    }
}